protocol Container {
    associatedtype ItemType
    
    mutating func append(_ item: ItemType)
    var count: Int { get }
    subscript(i: Int) -> ItemType { get }
}

func allItemsMatch<C1: Container, C2: Container>(container: C1, anotherContainer: C2) -> Bool where C1.ItemType == C2.ItemType, C1.ItemType: Equatable, C2: BinaryInteger
{
    if container.count != anotherContainer {
        return false
    }
    for i in 0..<container.count {
        if container[i] != anotherContainer[i] { return false }
    }
    return true
}
